package com.yita.fruit.servlets;

import com.yita.fruit.dao.Impl.FruitDaoImpl;
import com.yita.myssm.myspringmvc.ViewBaseServlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/del.do")
public class DeleteServlet extends ViewBaseServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String fid = req.getParameter("fid");

        boolean b = new FruitDaoImpl().delFruitById(fid);
        System.out.println("删除结果：" + b);
        resp.sendRedirect("/index");
    }
}
